1. Technical Field
The present invention relates to methods and devices for maintaining an image background, and more particularly, to a method and device for maintaining an image background by comparing a plurality of Gaussian models.
2. Related Art
Currently, to precisely detecting the moving object under a circumstance of changing background, moving-object detection techniques typically perform a learning process using an adapted-background technology for the changing background. To the detection systems, it is impossible to directly determine whether input pixels are attributable to a foreground or a background, the received pixels are usually added to a background model with a given corresponding weighting. For example, the more often a pixel or the like thereof is detected, the greater the weight value assigned to it. Pixels detected may be divided into two categories according to a threshold value; wherein the pixels with larger weight value are assigned as the background and the pixels with smaller weight value are assigned as the foreground. Therefore, the background is repeatedly updated and the foreground is separated from it, in order to locate the moving object.
However, it is possible for the foreground to be learned and incorporated into the background due to overstaying, or the foreground's marginal color may be similar to the color of the background and change the background color, both of which may cause misdetermination of the foreground. Such situations contribute to misinterpretation of the foreground. To address these problems, a common moving-object detection technique is to use background subtraction. As shown in FIG. 1, a picture is first captured in the frame when no object is moving in the frame. Next, every captured picture from the background is subtracted, and its absolute value obtained. In this way, when an object is shown in the frame, the object may be differentiated by means of the subtracted pictures.
When the background is affected by light, wind, or waves, it is necessary to provide a background-sensitive learning processing in response to changes of the background, such as a learning process based on a mixed Gaussian model. A mixed Gaussian model involves describing every pixel in the background by means of multiple Gaussian distributions that include an average and a covariance. Taking an RGB representation as an example, the average is the pixel RGB value, and the covariance is the scope of the Gaussian distribution. In a learning process based on a mixed Gaussian model, every Gaussian distribution is assigned a weight value, and the Gaussian distributions together cover the foreground and the background, allowing the foreground to be distinguished from the background according to the weighting.
Referring to FIG. 2, which is a learning process based on a conventional mixed Gaussian model. The learning process includes the following process: performing a Gaussian blur on a new picture to remove the effect of noise partially (S1); determining whether pixels of the new picture matches to multiple Gaussian distributions of a background (S2); increasing a weight on an affirmative determination to update the Gaussian distributions with the weight (S3), wherein updating the Gaussian distributions is to update the weight involves updating an average and a covariance; establishing a new Gaussian distribution of the background upon a negative determination to replace the Gaussian distribution having the least weight by the new Gaussian distribution and initiate the Gaussian distribution with a new pixel (S4); determining a threshold value according to the weights of the distributions, so as to determine the distributions attributed to the background to be discerned according to the threshold value (S5); processing input pictures by means of the distributions attributable to the background (S6); and extracting out a foreground to allow a moving object to be located later (S7).
However, despite their purpose of maintaining background images, the two methods described previously both fail to overcome the drawbacks of the prior art, that is, background-based learning is likely to be misinterpreted whenever the foreground overstays or the marginal color of the foreground approximates the color of the background. This is because an overstayed foreground has a relatively large weight, and is therefore likely to be mistaken for a background. Likewise, if the marginal color of a foreground approximates the color of the background and a Gaussian distribution is considered attributable to the background, the average of the Gaussian distribution will vary, allowing the background and the foreground to be equal in color, thus resulting in misinterpretation. Hence, the inventor of the present invention and persons skilled in the art are confronted with an issue that calls for immediate solution, that is, maintaining a background in such a way that the background remains unaffected by a foreground with a view to overcoming the aforesaid drawbacks of the prior art.